home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Pointing.h
-
- Contains: Pointer Family Interface
-
- Version: Technology: Copland
- Release: Universal Interfaces 3.0d3 on Copland DR1
-
- Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- */
- #ifndef __POINTING__
- #define __POINTING__
-
- #ifndef __KERNEL__
- #include <Kernel.h>
- #endif
- #ifndef __NAMEREGISTRY__
- #include <NameRegistry.h>
- #endif
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
- #if FOR_SYSTEM8_PREEMPTIVE
- /**************** Constants ****************/
-
- enum {
- kAnyDeviceClass = 'anyp',
- kMouseDeviceClass = 'mous',
- kTabletDeviceClass = 'tblt',
- kJoystickDeviceClass = 'joys',
- kTrackballDeviceClass = 'trkb',
- kTrackpadDeviceClass = 'trkp',
- k3DTrackballDeviceClass = '3dtb'
- };
-
-
- enum {
- kMinPTDataSize = 24
- };
-
-
- enum {
- kPointerFamilyError = -1,
- kPTUnknownRegEntryRef = -2,
- kPTInvalidTrackerRef = -3,
- kPTMemoryAllocationFailed = -4,
- kPTParamErr = -5
- };
-
- typedef UInt16 PTDataRelation;
-
- enum {
- kAbsoluteData = 1,
- kRelativeData = 2,
- kAbsoluteOrRelativeData = 3
- };
-
- /**************** Public Data Structures ****************/
- /* old name is TrackerID */
- typedef struct OpaquePTTrackerRef* PTTrackerRef;
- typedef unsigned long PTButtonState;
- typedef PTButtonState *PTButtonStatePtr;
- struct PTPosition {
- signed long x;
- signed long y;
- signed long z;
- };
- typedef struct PTPosition PTPosition;
-
- typedef PTPosition *PTPositionPtr;
- /* old name is PointerData */
- struct PTData {
- AbsoluteTime sequencingTag;
- PTPosition position;
- PTButtonState buttons;
- void * uniqueDeviceData;
- };
- typedef struct PTData PTData;
-
- typedef PTData *PTDataPtr;
- struct PTDeviceModes {
- PTDataRelation relation;
- void * uniqueDeviceModes;
- };
- typedef struct PTDeviceModes PTDeviceModes;
-
- typedef PTDeviceModes *PTDeviceModesPtr;
- typedef OSType PTDeviceClass;
- struct PTDeviceIdentifier {
- char identifier[255];
- };
- typedef struct PTDeviceIdentifier PTDeviceIdentifier;
-
- typedef PTDeviceIdentifier *PTDeviceIdentifierPtr;
- struct PTDeviceCapabilities {
- PTDeviceClass deviceClass;
- ByteCount dataSize;
- ByteCount modeDataSize;
- PTDataRelation availableDataRelations;
- PTDataRelation defaultDataRelation;
- long latency;
- Boolean imitatesMouse;
- };
- typedef struct PTDeviceCapabilities PTDeviceCapabilities;
-
- typedef PTDeviceCapabilities *PTDeviceCapabilitiesPtr;
- struct PTPinningRectList {
- short numRects; /* number of rects in list */
- Rect * pinningRect; /* pointer to a list of rects*/
- /* rects must be in global coordinates, in pixels*/
- };
- typedef struct PTPinningRectList PTPinningRectList;
-
- typedef PTPinningRectList *PTPinningRectListPtr;
- /**************** Client Interfaces ****************/
- /* *** Getting information about Devices *** */
- extern OSStatus PTGetNextDevice(RegEntryRef *currentDevice, PTDeviceClass filter, RegEntryRef **nextDevice);
-
- extern OSStatus PTGetDeviceCapabilities(RegEntryRef *device, PTDeviceCapabilities *capabilities);
-
- extern OSStatus PTGetDeviceIdentification(RegEntryRef *device, PTDeviceIdentifier *identification);
-
- /* *** Setting Device Modes *** */
- extern OSStatus PTGetDeviceModes(RegEntryRef *device, ByteCount offset, ByteCount numBytes, PTDeviceModes *modes);
-
- extern OSStatus PTSetDeviceModes(RegEntryRef *device, ByteCount offset, ByteCount numBytes, PTDeviceModes *modes);
-
- /* *** Registering with the Pointing Family *** */
- /*
- PTRegisterNewTracker:
- The client provides a reference to device she wants a connection with,
- and whether buffered and/or static data are needed. A TrackerRef is
- returned, which the client must use in all future communications with
- the Pointing Family. In addition, the size of the PTData structure
- that the given device generates is returned.
- */
- extern OSStatus PTRegisterNewTracker(RegEntryRef *device, Boolean bufferedData, Boolean stateData, PTTrackerRef *tracker, ByteCount *dataSize);
-
- /* *** Maintaining Trackers *** */
- extern OSStatus PTSetPinningRects(PTTrackerRef tracker, PTPinningRectList *rectList);
-
- /* *** Getting Data *** */
- /* DataSize indicates the size of the buffer allocated by the client for dataPtr. */
- extern OSStatus PTGetTrackerData(PTTrackerRef tracker, ByteCount dataSize, PTData *dataPtr);
-
- extern OSStatus PTFlushTrackerBuffer(PTTrackerRef tracker);
-
- /* *** Checking Tracker State *** */
- extern OSStatus PTGetPosition(PTTrackerRef tracker, PTPosition *position);
-
- extern OSStatus PTSetPosition(PTTrackerRef tracker, PTPosition *position);
-
- extern OSStatus PTMovePosition(PTTrackerRef tracker, PTPosition *position);
-
- extern OSStatus PTGetButtons(PTTrackerRef tracker, PTButtonState *buttons);
-
- extern OSStatus PTSetButtons(PTTrackerRef tracker, PTButtonState buttons);
-
- extern OSStatus PTGetTrackerState(PTTrackerRef tracker, ByteCount dataSize, PTData *data);
-
- extern OSStatus PTSetTrackerState(PTTrackerRef tracker, ByteCount dataSize, PTData *data);
-
- extern OSStatus PTGetTrackerDataByOffset(PTTrackerRef tracker, ByteCount offset, ByteCount numBytes, void *buffer);
-
- extern OSStatus PTSetTrackerDataByOffset(PTTrackerRef tracker, ByteCount offset, ByteCount numBytes, void *buffer);
-
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __POINTING__ */
-
-